package com.adfframeworks.labs.dao.impl;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.adfframeworks.labs.domain.Request;

public class RequestMapper implements RowMapper {

	@Override
	public Request mapRow(ResultSet rs, int rowNum) throws SQLException {
		Request request = new Request();
		request.setId(rs.getInt("Request_ID"));
		request.setFrom(rs.getInt("Request_From"));
		request.setTo(rs.getInt("Request_To"));
		request.setCommunity(rs.getInt("Community_ID"));
		request.setOwnerRequest(rs.getBoolean("Owner_Request"));
		return request;
	}
}